<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUserGoldLog extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_gold_log', function (Blueprint $table) {
            $table->integerIncrements('id');
            $table->unsignedInteger('user_id')->default(0)->comment('用户ID');
            $table->unsignedTinyInteger('type')->default(0)->comment('金币类型：1佣金，2平台奖励');
            $table->unsignedTinyInteger('account_type')->default(0)->comment('账目类型：1佣金收入，2平台奖励收入，3佣金提现，4平台奖励提现');
            $table->unsignedInteger('gold')->default(0)->comment('金币');
            $table->string('detail', 128)->default('')->comment('明细');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_gold_log');
    }
}
